package controller;

import java.util.ArrayList;

import javax.swing.AbstractListModel;
import javax.swing.event.ListSelectionEvent;

/**
 * 
 * Class Controller de la list de groupe
 * listGrp	Objet ArrayList<String>
 * 
 * @author Paul BEZARD-FALGAS
 *
 */
public class ControllerList extends AbstractListModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ArrayList<String> listGrp= null;
	
	public ControllerList(ArrayList<String> listGroup) {
        super();
        this.listGrp = listGroup;
	}

	public ArrayList<String> getListGrp() {
		return listGrp;
	}

	public void setListGrp(ArrayList<String> listGrp) {
		this.listGrp = listGrp;
	}

	@Override
	public Object getElementAt(int rowIndex) {
		return this.listGrp.get(rowIndex);
	}

	@Override
	public int getSize() {
		return this.listGrp.size();
	}
	
	public void valueChanged(ListSelectionEvent evt) {
	    System.out.println(evt);
	} 

}
